﻿//////////////////////////////////////////////////////////////////////////////////////
///// BadEnd.cs                                                         /////
///// 잘못된 출구로 나간 경우                                  /////
//////////////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace Pyramid_Game
{
    public class BadEnd : GameScreen
    {
        #region Declarations
        
        Texture2D badEnd;

        #endregion

        #region Load
        
        public BadEnd() {   }
        public override void LoadContent(ContentManager content)
        {
            badEnd = content.Load<Texture2D>("Texture/badend");
        }

        #endregion

        #region Update & Draw
        
        public override void Update(Touch touch, GameTime gameTime)
        {
            foreach (GestureSample gesture in touch.Gestures)
            {
                if (gesture.GestureType == GestureType.Tap)
                {
                    screenManager.RemoveScreen(this);
                    screenManager.AddScreen(new MainMenu());

                    GameConstants.Initialize();
                }
            }
        }
        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Draw(badEnd, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), Color.White);
        }

        #endregion
    }
}
